package com.kaishengit.service;

import java.util.List;

import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import com.kaishengit.pojo.User;

@Service
@Transactional
public class UserService extends BaseService {

	@Transactional(readOnly = true)
	public User findByUsernameAndPass(User user) {

		return getUserDao().findNameAndPassword(user);

	}

	public List<User> findAll() {
		return getUserDao().findAll();
	}

	public void save(User user) {
		getUserDao().save(user);
	}

	public User findById(String id) {

		return getUserDao().findById(id);
	}

	public User findByUsername(String username) {
		return getUserDao().findByName(username);
	}

}
